package com.efun.sample.web;

import com.efun.framework.web.ReturnT;
import com.efun.sample.entity.Person;
import com.efun.sample.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by kinven on 17/7/30.
 */
@RestController
public class PersonController {

    @Autowired
    PersonService personService;

    @RequestMapping("/person/all")
    public ReturnT<List<Person>> allperson(){
        ReturnT<List<Person>> result = new ReturnT<List<Person>>();
        result.setCode(200);
        result.setContent(personService.findAll());
        return result;
    }
}
